package com.zwl.springcloud.entity;

public class Result<T> {
    private String msg;
    private int code;
    private T data;

    //<editor-fold defaultstate="collapsed" desc="delombok">
    //省略getter和setter方法
    //</editor-fold>
    public Result(T data) {
        this.msg = "成功";
        this.code = 200;
        this.data = data;
    }

    public Result(String msg, int code, T data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public String getMsg() {
        return this.msg;
    }

    @SuppressWarnings("all")
    public int getCode() {
        return this.code;
    }

    @SuppressWarnings("all")
    public T getData() {
        return this.data;
    }

    @SuppressWarnings("all")
    public void setMsg(final String msg) {
        this.msg = msg;
    }

    @SuppressWarnings("all")
    public void setCode(final int code) {
        this.code = code;
    }

    @SuppressWarnings("all")
    public void setData(final T data) {
        this.data = data;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Result)) return false;
        final Result<?> other = (Result<?>) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getCode() != other.getCode()) return false;
        final Object this$msg = this.getMsg();
        final Object other$msg = other.getMsg();
        if (this$msg == null ? other$msg != null : !this$msg.equals(other$msg)) return false;
        final Object this$data = this.getData();
        final Object other$data = other.getData();
        if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof Result;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getCode();
        final Object $msg = this.getMsg();
        result = result * PRIME + ($msg == null ? 43 : $msg.hashCode());
        final Object $data = this.getData();
        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "Result(msg=" + this.getMsg() + ", code=" + this.getCode() + ", data=" + this.getData() + ")";
    }
    //</editor-fold>
}
